<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
    String actionURL = path + "/cms/customer/doQueryLevel.do";
%>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="<%=basePath%>">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<title>会员等级管理</title>
<link href="css/css-main.css" rel="stylesheet" type="text/css" />
<link rel=stylesheet type=text/css href="css/msgbox/jquery.msgbox.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/msgbox/jquery.dragndrop.min.js"></script>
<script type="text/javascript" src="js/msgbox/msgbox.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<link rel="stylesheet" href="css/validation/validationEngine.jquery.css" type="text/css"/>
<script src="js/validation/languages/jquery.validationEngine-zh_CN.js" ></script>
<script src="js/validation/jquery.validationEngine.js" ></script>
<script type="text/javascript">

//弹出隐藏层
function ShowDiv(show_div,bg_div){
document.getElementById(show_div).style.display='block';
document.getElementById(bg_div).style.display='block' ;
var bgdiv = document.getElementById(bg_div);
bgdiv.style.width = document.body.scrollWidth;
// bgdiv.style.height = $(document).height();
$("#"+bg_div).height($(document).height());
};
//关闭弹出层
function CloseDiv(show_div,bg_div)
{
document.getElementById(show_div).style.display='none';
document.getElementById(bg_div).style.display='none';
};

</script>
<script type="text/javascript">
function selectAll(fromName, boxname) {
	var f = document.forms[fromName];
	for ( var i = 0; i <= f.elements.length; i++) {
		if (f.elements[i].name == boxname) {
			f.elements[i].checked = !f.elements[i].checked;
		}

	}
}
/*
复选框删除功能 可以传递自定义描述
*  
*/
function confirmDel(doc)
{    
    var delNum = 0;
    var innerIndexs = doc.getElementsByName("innerIndexs");
   
    for(var i=0;i<innerIndexs.length;i++)
    {
           if(innerIndexs[i].checked)
           {
               delNum++;
           }
    }
     if(delNum <= 0)
    {    
        alert("请至少选择一条待删除记录");    
        return false;
    }
    var desc = "你确定要删除"+ delNum +"条记录吗？\n记录删除后将无法恢复！"; 
  
    if(window.confirm(desc))
    {
       document.form_del.submit();
       return true;
    }
    else
    {
      return false;
    }
}
</script>
<script>
		jQuery(document).ready(function(){
			// binds form submission and fields to the validation engine
			jQuery("#formId").validationEngine({
			promptPosition: "centerRight"});
 });
</script>
</head>
<body>
<div class="main-con"> 
  <!--//导航位置层-->
  
      <div class="main-bar"><span class="bar-position">当前位置：<a href="#">会员管理 &gt;&gt; 会员级别管理</a></span></div>
      <div class="cont_right_cont">
        <div>
          <div align="left">
<!--            <input name="button5" type="button" class="btn-cz" id="button2" value="增  加" onClick="ShowDiv('MyDiv','fade')">-->
            <input name="button5" type="button" class="btn-Yes" id="button2" value="增  加" onClick="$.toAdd(650,380,'新增会员级别','cms/customer/toAddLevel.do')">
            <input name="button2" type="button" class="btn-Yes" id="button2" value="删  除" onclick="confirmDel(document);" />
          </div>
        </div>
         <input  type="hidden" class="data-searchtxt-runtime" id="queryConditon_key" value="clientLevelName"/>
         <input  type="hidden" class="data-searchtxt-runtime" id="queryConditon_value" value=""/>
        <form name="form_del" id="form_del" target="hid" action="cms/customer/doDelLevel.do">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="datalist">
          <tr>
            <th width="4%"><input type="checkbox" name="checkbox" id="checkbox" onclick="selectAll('form_del','innerIndexs');"></th>
            <th>序号</th>
            <th>会员级别</th>
            <th>折扣</th>
            <th>保留时长</th>
            <th>操作</th>
          </tr>
          <tr>
            	<s:if test=" results.size == 0">
						</s:if>
						<!-- 存在记录 -->
						<s:if test=" results.size > 0">
							<!--显示List记录！-->
							<s:iterator value="results" status="s">
								<tr>
									<td><input type="checkbox" name="innerIndexs"
										id="innerIndexs"
										value='<s:property value="results[#s.index].clientLevelID"/>'>
									</td>
									<td><s:property value="#s.index+1" />
									</td>
									<td><s:property value="results[#s.index].clientLevelName" />
									</td>
									<td><s:property value="results[#s.index].discount" />
									</td>
									<td><s:property value="results[#s.index].longestRetention" />
									</td>
									<td>
									<a href="javascript:void(0);" onclick="$.toMod(650,380,'修改会员级别','cms/customer/toModLevel.do?innerIndex=<s:property value="results[#s.index].clientLevelID"/>')" class="ico_edit">修改</a>
									</td>
								</tr>
							</s:iterator>
						</s:if>
          </tr>
        </table>
        </form>
           <form name="pages" method="post" >
					<!--隐藏域 Start -->
					<!-- 引入分页和排序 -->
					<div style="display:none ">
						<input id="curPage" type="hidden" name="page.curPage" value="<s:property value='page.curPage'/>" /> 
						<input id="numPerPage" type="hidden" name="page.numPerPage" value="<s:property value='page.numPerPage'/>" />
                        <input type="hidden" id="queryConditon_key_hidden" name="queryConditon.key" value="<s:property value='queryConditon.key'/>" /> 
                        <input id="queryConditon_value_hidden" type="hidden" name="queryConditon.value" value="<s:property value='queryConditon.value'/>" />
                        <iframe name="hid" id="hid" src="" height="0px"></iframe>
					</div>
					
					<!--隐藏域 End   -->
				<div <s:if test=" results.size == 0">style="display:none"</s:if>>
					<%@include file="/jsp/cms/common/page.txt"%>
				</div>
		</form>
      </div>
    </div>

<!--弹出层时背景层DIV-->
<!-- 
div id="fade" class="black_overlay">
<div id="MyDiv" class="white_content">
  <div style="text-align:right;
	margin-right:10px; margin-top:10px">
    <span onClick="CloseDiv('MyDiv','fade')"><img src="images/ico_close.png" style="cursor: pointer;"></span></div>
    <div id="biaoti" style="text-align:left">会员级别管理</div>
	<form action="cms/customer/doAddLevel.do" method="post" id="formId">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="40" align="right">会员级别：</td>
      <td align="left"><input name="clientLevel.clientLevelName" type="text" class="data-searchtxt-runtime validate[required,maxSize[20] custom[chAndEnChar]] text-input"id="textfield1" /></td>
    </tr>
    <tr>
      <td height="40" align="right">折扣：</td>
      <td align="left"><input name="clientLevel.discount" type="text" class="data-searchtxt-runtime validate[required,custom[discount]]"id="textfield2" /></td>
    </tr>
     <tr>
      <td height="40" align="right">保留时长：</td>
      <td align="left"><input name="clientLevel.longestRetention" type="text" class="data-searchtxt-runtime"id="textfield3" /></td>
    </tr>
     <tr>
      <td height="40" align="right">备注：</td>
      <td align="left"><input name="clientLevel.clientLevelDesc" type="text" class="data-searchtxt-runtime"id="textfield4" /></td>
    </tr>
    <tr>
      <td height="40" colspan="2" align="center">
      <input name="button2" type="reset" class="btn-Yes" id="button2" value="重  置">
      <input name="button3" type="submit" class="btn-Yes" id="button3" value="确  定">
    <input name="button4" type="button" class="btn-No" id="button4" onclick="javascript:history.back(-1);" value="取消"></td>
    </tr>
  </table>
  </form>
</div>
</div>
--> 
<!-- 
<style>

.black_overlay {
	display: none;
	position: absolute;
	top: 0%;
	left: 0%;
	width: 100%;
	background-color: black;
	z-index:1001;
	-moz-opacity: 0.8;
	opacity:.50;
}
.white_content {
	display: none;
	position: absolute;
	top: 20%;
	left: 30%;
	width: 30%;
	border: 5px solid lightblue;
	background-color: white;
	z-index:1002;
	overflow: auto;
	padding-bottom:20px
}
</style>
 -->
<!--弹出层时背景层DIV-->

</body>
</html>
